
from fastapi import APIRouter, HTTPException, Path
from api.deps import SessionDep
from services import user_service
from schemas.response_schema import R
from schemas.user_schema import UserCreate,UserPublic
router = APIRouter()


@router.post("/",summary="创建新用户",response_model=R[UserPublic])
async def create_user(*,session:SessionDep,userCreate:UserCreate):
    "创建新用户"
    db_new_user = await user_service.create_new_user(session=session,user=userCreate)
    return R.success(db_new_user) 
